import React, { Component } from 'react';
import '../styles/MySeckill.css'
import { index_goodlist} from "../api/home";
class MySeckill extends Component {
    constructor(props) {
        super(props)
        this.state = {
            seckillList:[]
        }
    }
    componentDidMount() {
        index_goodlist().then((res) => {
            console.log(res.data.list)
            this.setState({
                seckillList:res.data.list
            })
        })
    }
    render() {
        return (
            <div className='seckill'>
                {
                    this.state.seckillList.map((item, index) => {
                        return (
                            <div className='list'  key={index}>
                                <img src={ item.pic} alt="" />
                                <p>{item.name}</p>
                                <p className='sall'>{ item.activityTags[0]}</p>
                                <span>抢购价{ item.salesPrice.value}</span>
                        </div>
                        )
                    })
               }
            </div>
        );
    }
}

export default MySeckill;
